﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WithHookSample
{
    public abstract class AbstractClass
    {
        public void templateMethod()
        {
            primitiveOperation1();
            primitiveOperation2();
            concreteOperation();
            hook();
        }

        public abstract void primitiveOperation1();
        public abstract void primitiveOperation2();
        /// <summary>
        /// 添加对hook的调用条件
        /// </summary>
        void concreteOperation()
        {
            //ToDo
        }

        void hook() { }
    }
}
